Skip to content

Additional sanity checks for QNX + CAAM resource manager - #11263

Open
JacobBarthelmeh wants to merge 3 commits into
wolfSSL:masterfrom
JacobBarthelmeh:qnx
Open

Additional sanity checks for QNX + CAAM resource manager#11263
JacobBarthelmeh wants to merge 3 commits into
wolfSSL:masterfrom
JacobBarthelmeh:qnx

Conversation

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor

For internal reports f-11224 and f-8236

@JacobBarthelmeh JacobBarthelmeh self-assigned this Aug 25, 2026
@JacobBarthelmeh
JacobBarthelmeh requested review from wolfSSL-Fenrir-bot and a lite review from Copilot August 25, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds defensive validation around untrusted client-provided sizes/flags for CAAM QNX resmgr operations and makes the device node permissions configurable.

Changes:

  • Introduces WOLFSSL_CAAM_QNX_MAX_SZ and WOLFSSL_CAAM_QNX_DEV_MODE configuration macros.
  • Adds size sanity checks and safer aggregate-size arithmetic in CMAC and AES paths.
  • Tightens read-length validation to avoid partially-initialized buffers being used.
Suppressed comments (1)

wolfcrypt/src/port/caam/caam_qnx.c:428

  • When resmgr_msgreadv() fails (ret < 0), returning EOVERFLOW conflates an I/O error with a short-read/undersized message, and hides the underlying failure mode. Handle ret < 0 separately (e.g., return ECANCELED or the appropriate errno from the resmgr layer), and reserve EOVERFLOW (or EBADMSG) for the ret < expSz short-read case.
    expSz = msgSz + keySz + (int)sizeof(ctx);
    ret = resmgr_msgreadv(ctp, in_iovs, numBuf, idx);
    if (ret < 0 || ret < expSz) {
        /* sanity check that the read worked and enough data was sent */
        if (buf != NULL)
            CAAM_ADR_UNMAP(buf, 0, msgSz, 0);
        return EOVERFLOW;
    }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread wolfcrypt/src/port/caam/caam_qnx.c
Comment thread wolfcrypt/src/port/caam/caam_qnx.c Outdated
Comment thread wolfcrypt/src/port/caam/caam_qnx.c
@wolfSSL-Bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

@JacobBarthelmeh

JacobBarthelmeh commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins Opps not found +5

@philljj
philljj requested review from wolfSSL-Fenrir-bot and removed request for wolfSSL-Fenrir-bot August 31, 2026 20:11

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #11263

Scan targets checked: wolfcrypt-port-bugs

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Comment thread wolfcrypt/src/port/caam/caam_qnx.c Outdated
Comment thread wolfcrypt/src/port/caam/caam_qnx.c Outdated

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #11263

Scan targets checked: wolfcrypt-port-bugs

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

@wolfSSL-Fenrir-bot
wolfSSL-Fenrir-bot dismissed their stale review August 31, 2026 20:47

Fenrir's latest completed scan found no issues; clearing the prior automated change request.

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins, Opps not found

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins. ABI test failed,

FATAL: command execution failed
java.io.EOFException
...
Parsed console shows:
Hudson.remoting.ChannelClosedException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants